package 线程;

public class ClimbThread implements Runnable {
    int millions;//怕00米所用的秒
    int rank;//爬多少个100米

    public ClimbThread(int millions, int rank) {
        this.millions = millions;
        this.rank = rank;
    }

    @Override
    public void run() {
        for (int i=1;i<rank;i++) {
            try {
                Thread.sleep(millions * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + "爬了100米");
        }
        System.out.println(Thread.currentThread().getName()+"俯瞰天下");
    }
}
